#include "Mutex.hpp"



System::Mutex::Mutex()
{
	pthread_mutex_init(&_mutex, NULL);
}



System::Mutex::~Mutex()
{
	pthread_mutex_destroy(&_mutex);
}



void System::Mutex::lock()
{
	pthread_mutex_lock(&_mutex);
}



void System::Mutex::unlock()
{
	pthread_mutex_unlock(&_mutex);
}



bool System::Mutex::tryLock()
{
	return !pthread_mutex_trylock(&_mutex);
}




